<?php htmlTemplate('admin_header_frame.php');?>
<div class="title">设置菜单
<?php if ($user['isadmin']!=3){?>
<a  href="<?php echo ZSM_WWW_HOST.'admin.php/admin/video/list/'?>" class="title_button">视频列表</a>
<?php }?>
</div>
<script type="text/javascript">
function setThumbImg(src){

	$("#thumb").val(src);

}
function checkForm(){	
	var star = $.trim($("#star").val());	
	var tostar = $.trim($("#tostar").val());
	var match = $.trim($("#match").val());
	var link = $.trim($("#link").val());
	var thumb = $.trim($("#thumb").val());
	var title = $.trim($("#title").val());
	var content = $.trim(KE.util.getData('content'));
	
	<?php
	if (@$row) {
		$url=ZSM_WWW_HOST.'admin.php/admin/video/set/do/update/id/'.$row['id'];
	}else{
		$url=ZSM_WWW_HOST.'admin.php/admin/video/set/do/add';
	}
	?>
	var url = '<?php echo $url;?>';
	
	$.post(url,{
		'star':star,
		'tostar':tostar,
		'match':match,
		'link':link,
		'thumb':thumb,
		'title':title,
		'content':content		
		},function(rs){
			parent.showAlert(rs);
			setTimeout(function(e){
				window.location.reload();
			},3000);
	})
	
	return false;
}
</script>

<form action="" method="post" onsubmit="return checkForm();">
<table style="width:100%;line-height: 35px;">
	
 
	<?php
	echoEditTr($row,'球星','star',200);
	echoEditTr($row,'对阵球星','tostar',200);
	echoEditTr($row,'标题','title',300);
	echoEditTr($row,'赛事','match','','select','match','match',$match,'name','name');
	echoEditTr($row,'详情','content',800,'content');
	echoEditTr($row,'缩略图','thumb',400,'thumb');
	echoEditTr($row,'视频地址','link',400);
	?>

	
	<tr>
		<td align="right"  width="20%" ><input type="submit" class="submit" value="确 认">&nbsp;</td>
		<td align="left"  width="80%" >&nbsp;</td>
		
	</tr>
	
	
</table>
</form>
<script type="text/javascript">
function cutimg(thumbid)
{
	 
	if (!thumbid){
		thumbid='thumb';
	}
	var img = $.trim($("#"+thumbid).val());
	if (img ==''){
		parent.showAlert('请先上传图片！');
		return false;
	}
	var url = '<?php echo ZSM_WWW_HOST.'admin/api/cutimg?imgsrc='?>'+img+'&thumbid='+thumbid;
	showFrame(url,500,450);
}

</script>
<?php htmlTemplate('admin_footer_frame.php');?>